package com.atguigu.eduservice.entity.vo;

import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

/**
 * 课程查询条件实体
 */
@Data
public class CourserQuery {

    @ApiModelProperty("页面大小 默认 15")
    private Integer pageSize = 10;

    @ApiModelProperty("当前页面 默认 1")
    private Integer pageNum = 1;

    @ApiModelProperty("标题")
    private String title;

    @ApiModelProperty("状态")
    private String status = "all";

    @ApiModelProperty("开始时间")
    private String startTime;

    @ApiModelProperty("结束时间")
    private String endTime;

    public void setStartTime(String startTime) {
        if (StringUtils.isNotEmpty(startTime)) {
            this.startTime = startTime + " 00:00:00";
        }
    }

    public void setEndTime(String endTime) {
        if (StringUtils.isNotEmpty(endTime)) {
            this.endTime = endTime + " 23:59:59";
        }
    }
}
